<template>
    <div class="news">
        <ul>
            <li v-for="news in newslist" :key="news.id">
                <RouterLink :to="{path:'/news/detail',
                    query:{
                        id:news.id,
                        title:news.title,
                        content:news.content
                    }
                }">{{news.title}}</RouterLink>
            </li>
        </ul>
        <div class="news-content">
            <RouterView></RouterView>
        </div>
    </div>
</template>
<script setup lang="ts" name="News">
import { reactive } from 'vue';
import { RouterView, RouterLink } from 'vue-router';
const newslist=reactive([
    {id:1,title:"很好的抗癌食物",content:"西蓝花"},
    {id:2,title:"俄乌战争开始",content:"俄乌战争发生于2022.2.24日"},
    {id:3,title:"震惊",content:"以色列于2024.4月份从加沙撤离了大量部队"},
    {id:4,title:"痛惜",content:"复旦大学第一位女院士死于2024.2月份"},
    ])
</script>
<style scoped>
.news {
 padding: 0 20px;
 display: flex;
 justify-content: space-between;
 height: 100%;
}
.news nl{
    margin-top: 30px;
    list-style: none;
    padding-left: 10px;
}
.news li>a{
    font-size: 18px;
    line-height: 40px;
    text-decoration: none;
    color: #64967E;
    text-shadow: 0 0 1px rgb(0,84,0);
}
.news-content {
  width: 70%;
  height: 90%;
  border: 1px solid;
  margin-top: 20px;
  border-radius: 10px;
}
.news ul{
    margin-top: 30px;
    padding-left: 10px;
}
.news li::marker {
    color: #64967E;

}
</style>  